package com.tengju.user.domain.model.sign;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum StarChangeNoticeTypeEnum {

    UPGRADE(1, "升星"),
    DOWNGRADE(2, "降星"),
    UPCOMING(3, "即将晋升");

    private int type;
    private String desc;

    private StarChangeNoticeTypeEnum(int type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public int getType() {
        return type;
    }

    public static StarChangeNoticeTypeEnum getByType(int type) {
        return Arrays.stream(StarChangeNoticeTypeEnum.values()).filter(k->k.getType() == type)
                .findFirst().orElse(null);
    }
}
